package com.example.tool.activtiy;

import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.example.tool.R;
import com.example.tool.activtiy.base.BaseActivity;
import com.example.tool.adapter.ShowAdapter;
import com.example.tool.mvp.CommonPresent;
import com.example.tool.util.DebugLog;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * Created Date 2019/8/25.
 *
 * @author liangkun
 * ClassDescription：折叠布局，这个布局是导致toolbar没有了
 *
 */
public class CoordActivity extends BaseActivity<CommonPresent> {
    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;
    @BindView(R.id.fab)
    FloatingActionButton floatingActionButton;
    private List<String> mDatas=  new ArrayList<>();
    private ShowAdapter showAdapter;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_coord;
    }

    @Override
    protected void initView() {
//        tvLeft.setText(R.string.ui_my);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
        recyclerView.setLayoutManager(layoutManager);
        DebugLog.d(DebugLog.KUN + "mDatas " + mDatas.size());
        showAdapter = new ShowAdapter(this,mDatas,R.layout.home_list);
    }

    @Override
    protected void initData() {
        initDatas();
        recyclerView.setAdapter(showAdapter);
    }

    @Override
    protected void initEvent() {
        //分支代码合到主干
    }

    @Override
    protected CommonPresent createPresenter() {
        return null;
    }

    /**
     * 获取数据
     */
    private void initDatas() {
        for (int i = 'A'; i <= 'z'; i++) {
            mDatas.add((char) i + "");
        }
    }
}
